/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import model.dao.AlunoJpaController;
import model.dao.exceptions.NonexistentEntityException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import model.pojo.Aluno;

/**
 *
 * @author yuri
 */
public class Main {
    private static final String PERSISTENCE_UNIT_NAME = "joao_maria_pedro_yuri";
    private static EntityManagerFactory factory =
    Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);

    public static void main(String args[]) {
        
        AlunoJpaController jpa = new AlunoJpaController(factory);
        Aluno a = new Aluno();
        a.setNome("yuri");
        a.setCpf("07789273698");
        //jpa.create(a);
       // a.setId(new Long(51));
        
        List<Aluno> lista = jpa.exemplo("");
        for (Aluno aluno : lista) {
            
        
            
            System.out.println(a.getNome()+"  "+aluno.getId());
        }
        
        
    }
}
